********************************************************************************
********************************************************************************
** Robustness analysis 11
** Heterogeneity in regard to year of exams (separately for each cohort)
********************************************************************************
********************************************************************************

** Load data
use "$dataraw_path\data_ftna_publication.dta", clear


eststo rob11_1: areg gpa_ftna_core_sd 1.private female uncommon_name ///
	peers_score_core_sd peers_fail_share peers_as_share gpa_psle_other_sd ///
	if sample==1 & year==2015, cl(school_id) a(group_id)

eststo rob11_2: areg gpa_ftna_core_sd 1.private female uncommon_name ///
	peers_score_core_sd peers_fail_share peers_as_share gpa_psle_other_sd ///
	if sample==1 & year==2016, cl(school_id) a(group_id)

eststo rob11_3: areg gpa_ftna_core_sd 1.private female uncommon_name ///
	peers_score_core_sd peers_fail_share peers_as_share gpa_psle_other_sd ///
	if sample==1 & year==2017, cl(school_id) a(group_id)

eststo rob11_4: areg gpa_ftna_core_sd private##i.year female uncommon_name ///
	peers_score_core_sd peers_fail_share peers_as_share gpa_psle_other_sd ///
	if sample==1, cl(school_id) a(group_id)

* Output
esttab rob11_* using "$out_path\tableb8.tex", replace se ///
stats(N r2, fmt(%12.3gc) labels("\(N\)" "\(R^2\)")) compress nomtitles ///
starlevels("" 0.01) substitute(\_ _) b(3) ///
/*KEEP*/k(1.private 1.private#2016.year 1.private#2017.year) ///
/*ORDER*/o(1.private 1.private#2016.year 1.private#2017.year) ///
/*LABELS*/varl(1.private "\$Private_s$" ///
1.private#2016.year "\$Private_s \times Cohort\emph{16}$" ///
1.private#2017.year "\$Private_s \times Cohort\emph{17}$")
